package sale.interfaces;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;

import article.entities.ArticleVO;
import article.exceptions.OutOfStockIngredientsException;
import sale.entities.FacturaVO;
import sale.entities.OrderVO;
import sale.entities.SaleVO;
import sale.exceptions.EmptyOrderException;
import sale.exceptions.EmptySaleExcpetion;
import sale.exceptions.NoSalesException;

public interface SaleRemoteMgt extends Remote {

	SaleVO[] getOpenSales() throws RemoteException, NoSalesException;

	SaleVO[] getOpenTakeoOutSales() throws RemoteException, NoSalesException;

	SaleVO[] getOpenDeliverySales() throws RemoteException, NoSalesException;

	void newSale(OrderVO ord, int tableKey, int ci) throws RemoteException,
			EmptyOrderException, OutOfStockIngredientsException;

	void addOrder(OrderVO ord, int tableKey)
			throws RemoteException, EmptySaleExcpetion, OutOfStockIngredientsException;

	FacturaVO close(SaleVO sale) throws RemoteException, EmptySaleExcpetion;
	
	void commit(FacturaVO fact) throws RemoteException;

	void deleteArticles(SaleVO sale, ArrayList<ArticleVO> arts)
			throws RemoteException;

	boolean hasOpenSale(int tableKey) throws RemoteException;
	
	SaleVO getSale(int tableKey) throws RemoteException;

	int[] getOpenTables() throws RemoteException;
	
	OrderVO[] getOpenOrders() throws RemoteException;
	
	

}
